/* This program is free software. It comes without any warranty, to
 * the extent permitted by applicable law. You can redistribute it
 * and/or modify it under the terms of the Do What The Fuck You Want
 * To Public License, Version 2, as published by Sam Hocevar. See
 * http://sam.zoy.org/wtfpl/COPYING for more details. */ 
package de.rockon.fuzzy.controller.model.commands;

import de.rockon.fuzzy.controller.model.FuzzyPoint;
import de.rockon.fuzzy.controller.model.FuzzySet;
import de.rockon.fuzzy.exceptions.DuplicateXValueException;
import de.rockon.fuzzy.exceptions.ValueOutOfDomainException;

/**
 * Unser Command-Pattern
 */
public class TrapezePointSetCommand implements ICommand {
	private FuzzySet fuzzySet = null;

	/**
	 * Der Konstruktor
	 */
	public TrapezePointSetCommand(FuzzySet fuzzySet) {
		this.fuzzySet = fuzzySet;
	}

	@Override
	public void execute() {
		try {
			fuzzySet.add(new FuzzyPoint(0, 0));
			fuzzySet.add(new FuzzyPoint(1, 1));
			fuzzySet.add(new FuzzyPoint(2, 1));
			fuzzySet.add(new FuzzyPoint(3, 0));
		} catch (ValueOutOfDomainException e) {
			e.printStackTrace();
		} catch (DuplicateXValueException e) {
			e.printStackTrace();
		}
	}

	@Override
	public void redo() {
		// TODO Auto-generated method stub

	}

	@Override
	public void undo() {
		// TODO Auto-generated method stub

	}
}
